<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    // setInterval(function(){
    //     console.log("定时器执行");
    //     },1000);
    function fn(){
        console.log("定时器执行");
    }
    let n = setInterval(fn,1000);
    // setInterval(fn,1000);
    console.log(n);
    clearInterval(n); // 停止定时器
    </script>
</body>
</html>